Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Manipulating Rotate Transforms

QuickDraw 3D provides routines that you can use to create and manipulate rotate transforms. A rotate transform rotates an object about the x , y , or z axis by a specified number of radians. You can use macros to convert radians to degrees if you prefer to work with degrees instead of radians. See the chapter "Mathematical Utilities" for more information.

Q3RotateTransform_New

You can use the Q3RotateTransform_New function to create a new rotate transform.

TQ3TransformObject Q3RotateTransform_New (
                     const TQ3RotateTransformData *data);
data
A pointer to a rotate transform data structure.

DESCRIPTION

The Q3RotateTransform_New function returns, as its function result, a reference to a new transform object of type kQ3TransformTypeRotate using the data passed in the data parameter. The data you pass is copied into internal QuickDraw 3D data structures. If QuickDraw 3D cannot allocate memory for those structures, Q3RotateTransform_New returns the value NULL .

Q3RotateTransform_Submit

You can use the Q3RotateTransform_Submit function to submit a rotate transform without creating an object or allocating memory.

TQ3Status Q3RotateTransform_Submit (
                     const TQ3RotateTransformData *data,
                     TQ3ViewObject view);
data
A pointer to a rotate transform data structure.
view
A view.

DESCRIPTION

The Q3RotateTransform_Submit function pushes the rotate transform specified by the data parameter onto the view transform stack of the view specified by the view parameter. The function returns kQ3Success if the operation succeeds and kQ3Failure otherwise.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3RotateTransform_GetData

You can use the Q3RotateTransform_GetData function to query the private data stored in a rotate transform.

TQ3Status Q3RotateTransform_GetData (
                     TQ3TransformObject transform,
                     TQ3RotateTransformData *data);
transform
A rotate transform.
data
A pointer to a rotate transform data structure.

DESCRIPTION

The Q3RotateTransform_GetData function returns, in the data parameter, information about the rotate transform specified by the transform parameter. You should use Q3RotateTransform_GetData only with transforms of type kQ3TransformTypeRotate .

Q3RotateTransform_SetData

You can use the Q3RotateTransform_SetData function to set new private data for a rotate transform.

TQ3Status Q3RotateTransform_SetData (
                     TQ3TransformObject transform,
                     const TQ3RotateTransformData *data);
transform
A rotate transform.
data
A pointer to a rotate transform data structure.

DESCRIPTION

The Q3RotateTransform_SetData function sets the rotate transform specified by the transform parameter to the data passed in the data parameter. You should use Q3RotateTransform_SetData only with transforms of type kQ3TransformTypeRotate .

Q3RotateTransform_GetAxis

You can use the Q3RotateTransform_GetAxis function to get the axis of a rotate transform.

TQ3Status Q3RotateTransform_GetAxis (
                     TQ3TransformObject transform,
                     TQ3Axis *axis);
transform
A rotate transform.
axis
On exit, the axis of the specified rotate transform.

DESCRIPTION

The Q3RotateTransform_GetAxis function returns, in the axis parameter, the current axis of rotation of the rotate transform specified by the transform parameter.

Q3RotateTransform_SetAxis

You can use the Q3RotateTransform_SetAxis function to set the axis of a rotate transform.

TQ3Status Q3RotateTransform_SetAxis (
                     TQ3TransformObject transform,
                     TQ3Axis axis);
transform
A rotate transform.
axis
The desired axis of the specified rotate transform.

DESCRIPTION

The Q3RotateTransform_SetAxis function sets the axis of rotation for the rotate transform specified by the transform parameter to the value passed in the axis parameter.

Q3RotateTransform_GetAngle

You can use the Q3RotateTransform_GetAngle function to get the angle of a rotate transform.

TQ3Status Q3RotateTransform_GetAngle (
                     TQ3TransformObject transform,
                     float *radians);
transform
A rotate transform.
radians
On exit, the angle, in radians, of the specified rotate transform.

DESCRIPTION

The Q3RotateTransform_GetAngle function returns, in the radians parameter, the current angle of rotation (in radians) of the rotate transform specified by the transform parameter.

Q3RotateTransform_SetAngle

You can use the Q3RotateTransform_SetAngle function to set the angle of a rotate transform.

TQ3Status Q3RotateTransform_SetAngle (
                     TQ3TransformObject transform,
                     float radians);
transform
A rotate transform.
radians
The desired angle, in radians, of the specified rotate transform.

DESCRIPTION

The Q3RotateTransform_SetAngle function sets the angle of rotation for the rotate transform specified by the transform parameter to the value passed in the radians parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |